﻿using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Common;
using Common.ParameterLocator;
using SpecFlowTfsLinker.Entities;
using SpecFlowTfsLinker.Printer;

namespace SpecFlowTfsLinker.Parser
{
    [Serializable]
    public static class ParameterParser
    {
        public static List<ParameterPrinter> ExtractParametersFromStatement(string statement)
        {
            var parameters = new List<ParameterPrinter>();

            var regex = new Regex(ServiceParameter.Instance.Parameter.RegexFindParameter);
            foreach (var match in regex.Matches(statement))
            {
                parameters.Add(new ParameterPrinter(match.ToString()));
            }
            return parameters;
        }
    }
}